Next: 5.2 Reliability Assurances
Up: 5 Multi-rendering Implementation
Previous: 5 Multi-rendering Implementation
Figure 4: Simplified diagram showing the synchronization points
for an X client rendering OpenGL through the X server using
multi-rendering. Solid lines represent flow of control;
dashed lines indicate where one thread resumes
another.
Figure 4 shows the synchronization that takes place
between a client, the
X server, and a rendering thread when an OpenGL rendering request is
executed.
- An OpenGL client sends a GLX extension request, which contains a
batch of OpenGL commands.
- The X server receives the request and dispatches it to the
GLX extension.
- The request is handed over to the client's rendering thread.
Request input from this client is suspended by calling
IgnoreClient.
- The rendering thread wakes up to receive the request.
- The rendering thread decodes the batch of commands in the request,
issuing a call to the OpenGL rendering library for each command.
The rendering library attempts to access the graphics hardware
pages.
- Assuming an invalid RRM resource for the rendering node,
the page access causes a fault, and the kernel sends an RRM
message to the X server for resource validation.
- The X server receives and dispatches the RRM message.
- Resources are validated and a response is sent to the kernel.
- The kernel remaps the graphics hardware pages and resumes
execution of the rendering thread.
- The rendering thread announces that it has completed the rendering
request by releasing the polling semaphore.
- The semaphore release causes the X server to wake up from
select. A wakeup handler notices that the OpenGL thread
has finished rendering, and resumes request input from the
client by calling AttendClient.
- Returned data, if any, is sent to the client.
Steps 6 through 9 demonstrate the handling of an invalid RRM resource.
In this case, the operating
system has unmapped the renderer's graphics pipe due to some invalid
RRM resource. The X server's main thread and kernel conspire to
validate the invalid
resource transparently.
This is not the common case but does happen when the window's
drawable clip changes or the rendering node is requesting a buffer swap
and the window does not have an unshared display ID. It is possible for multiple
RRM resource validations to occur during a rendering thread's execution.
Note that in
Figure 4, there is only a single point where the main
X server thread blocks. This allows the main X server thread to avoid
deadlock when it is both waiting for a rendering thread request to complete
and handling RRM resource validation requests for blocked rendering
threads.
Next: 5.2 Reliability Assurances
Up: 5 Multi-rendering Implementation
Previous: 5 Multi-rendering Implementation
Mark Kilgard
Sun Jan 7 19:20:04 PST 1996